﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class School
{
    static void Main()
    {
        Student student = new Student("Uchko", 3);
        student.PrintName();
        Discipline math = new Discipline("Mathematic", 4, 4);
        math.PrintName();
        Teacher teach = new Teacher("Daskal", math);
        teach.PrintName();
        StudyClass client = new StudyClass("12a", teach, student);
        client.PrintName();
    }
}
class People
{
    private string name;
    public People(String n)
    {
        name = n;
    }
    public String Name
    {
        get { return name; }
        set { name = value; }
    }
    public void PrintName()
    {
        Console.WriteLine("Name is {0}", name);
    }
}
class Student : People
{
    private int classNumber;
    public Student(string name, int number)
        : base(name)
    {
        classNumber = number;
    }
    public int ClassNumber
    {
        get { return classNumber; }
        set { classNumber = value; }
    }
    public new void PrintName()
    {
        base.PrintName();
        Console.WriteLine("Class number is {0}", classNumber);
    }
}
class Teacher : People
{
    Discipline discipline;
    public Teacher(string name, Discipline dis)
        : base(name)
    {
        discipline = dis;
    }
    public Discipline Discipline
    {
        get { return discipline; }
        set { discipline = value; }
    }
    public new void PrintName()
    {
        base.PrintName();
        Console.WriteLine("Teacher discipline is {0} and has {1}  lectures and {2} exercise", discipline.Name, discipline.NumberOfLec
            , discipline.NumberOfEx);
    }
}
class StudyClass
{
    private string identifier;
    Teacher teacher;
    Student student;
    public StudyClass(string ident, Teacher teach, Student stud)
    {
        identifier = ident;
        teacher = teach;
        student = stud;
    }
    public void PrintName()
    {
        Console.WriteLine("The class {0} has teacher: {1} and student {2}", identifier, teacher.Name, student.Name);
    }
}
class Discipline
{
    private string name;
    private int numberOfLec;
    private int numberOfEx;
    public Discipline(string name, int lec, int ex)
    {
        this.name = name;
        numberOfLec = lec;
        numberOfEx = ex;
    }
    public string Name
    {
        get { return name; }
        set { name = value; }
    }
    public int NumberOfLec
    {
        get { return numberOfLec; }
        set { numberOfLec = value; }
    }
    public int NumberOfEx
    {
        get { return numberOfEx; }
        set { numberOfEx = value; }
    }
    public void PrintName()
    {
        Console.WriteLine("Discipline {0} has {1}  lectures and {2} exercise", name, numberOfLec, numberOfEx);
    }
}

